<?php

namespace app\admin\validate;

use think\Validate;

class WechatUser extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'userid' => 'require|max:50|unique:wechat_user',
        'name' => 'require',
        'password' => 'require',
        'email'    => 'require|email|unique:wechat_user,email',
		'mobile' => 'require|max:11|unique:wechat_user',
		
    ];



    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['userid', 'email', 'name', 'password','mobile'],
        'edit' => ['userid', 'email', 'name','mobile'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'username' => __('Userid'),
            'name' => __('Name'),
            'password' => __('Password'),
            'email'    => __('Email'),
            'mobile'    => __('Mobile'),
        ];
        parent::__construct($rules, $message, $field);
    }

    
}
